
(function($, h, c) {  
    var a = $([]), e = $.resize = $.extend($.resize, {}), i, k = "setTimeout", j = "resize", d = j  
            + "-special-event", b = "delay", f = "throttleWindow";  
    e[b] = 350;  
    e[f] = true;  
    $.event.special[j] = {  
        setup : function() {  
            if (!e[f] && this[k]) {  
                return false  
            }  
            var l = $(this);  
            a = a.add(l);  
            $.data(this, d, {  
                w : l.width(),  
                h : l.height()  
            });  
            if (a.length === 1) {  
                g()  
            }  
        },  
        teardown : function() {  
            if (!e[f] && this[k]) {  
                return false  
            }  
            var l = $(this);  
            a = a.not(l);  
            l.removeData(d);  
            if (!a.length) {  
                clearTimeout(i)  
            }  
        },  
        add : function(l) {  
            if (!e[f] && this[k]) {  
                return false  
            }  
            var n;  
            function m(s, o, p) {  
                var q = $(this), r = $.data(this, d);  
                r.w = o !== c ? o : q.width();  
                r.h = p !== c ? p : q.height();  
                n.apply(this, arguments)  
            }  
            if ($.isFunction(l)) {  
                n = l;  
                return m  
            } else {  
                n = l.handler;  
                l.handler = m  
            }  
        }  
    };  
    function g() {  
        i = h[k](function() {  
            a.each(function() {  
                var n = $(this), m = n.width(), l = n.height(), o = $  
                        .data(this, d);  
                if (m !== o.w || l !== o.h) {  
                    n.trigger(j, [ o.w = m, o.h = l ])  
                }  
            });  
            g()  
        }, e[b])  
    }  
})(jQuery, this);  

$(function(){

	var _list=$('.product-title li');
	var _content=$('.product-content .product-child');
	_list.on('click',function(){
		var index=$(this).index();
		// $(this).css({'border-bottom':'2px solid #00aaff','color':'#00aaff'}).siblings('.product-title li').css({'border-bottom':'none','color':'#333'});
		$(this).addClass('title-active').siblings('.product-title li').removeClass('title-active');
		_content.eq(index).show().siblings('.product-content .product-child').hide();
	});

	var _list1=$('.product-title1 li');
	var _content1=$('.product-content1 .product-child1');
	_list1.on('click',function(){
		var index=$(this).index();
		// $(this).css({'border-bottom':'2px solid #00aaff','color':'#00aaff'}).siblings('.product-title li').css({'border-bottom':'none','color':'#333'});
		$(this).addClass('title-active').siblings('.product-title1 li').removeClass('title-active');
		_content1.eq(index).show().siblings('.product-content1 .product-child1').hide();
	});


	//左侧菜单移入移出事件
	$('.Hui-aside .menu_dropdown li a').on('mouseover',function(){
		$(this).css('color','#326EF7');
	}).on('mouseout',function(){
		$(this).css('color','#757575');
	});
	// $(document).ready(function(){
	// 	$('.Hui-aside dl:first-child li:first-child').bind("myClick", function(){ 
	// 		$(this).children('a').click();
	// 	  	$('.Hui-aside .menu_dropdown li a').removeClass('hover-active');
	// 		$('.Hui-aside .menu_dropdown li a').css('color','#757575');

	// 		if('.menu-active'){
	// 			$('.Hui-aside .menu_dropdown li').removeClass('check-active');
	// 		}
	// 		$(this).addClass('check-active');
	// 		$(this).children('a').addClass('hover-active');
	// 		$(window).scrollTop(0);
	// 	});
	// 	$('.Hui-aside dl:first-child li:first-child').trigger('myClick')
	// });
	//左侧菜单点击事件
	$('.Hui-aside .menu_dropdown li').on('click',function(){
		//派发事件 菜单 start
		var obj = $(this);
		var aobj = obj.children('a');
		var ul = obj.parent('ul');
		var dt = ul.parent('dd').prev('dt').text();
		var li = ul.children('li');
		var menu_1 = li.eq(0).children('a');
		$('#menu_i_1').text(dt).data('obj',menu_1);
		$('#menu_i_2').text(aobj.attr('data-title')).data('obj',aobj);
		//派发事件 菜单  end
		$('.Hui-aside .menu_dropdown li a').removeClass('hover-active');
		$('.Hui-aside .menu_dropdown li a').css('color','#757575');

		if('.menu-active'){
			$('.Hui-aside .menu_dropdown li').removeClass('check-active');
		}
		$(this).addClass('check-active');
		$(this).children('a').addClass('hover-active');
		$(window).scrollTop(0);
	});
	
	//菜单导航  一二级  
	$('#menu_i_1').on('click',function(){
		$(this).data('obj').click();
	})

	$('#menu_i_2').on('click',function(){
		$(this).data('obj').click();
	})
	$('.chose-select-val').on(' mouseleave',function(){
		$(this).hide();
	});
    $('.save-input-val').click(function(){
    	$(this).next().click();
    })
    $('.chose-select-val1').on(' mouseleave',function(){
		$(this).hide();
	});
    $('.save-input-val1').click(function(){
    	$(this).next().click();
    })
	//下拉列表
		$('.btn-icon-select').on('click',function(){
		var _parent_ul=$(this).parent('.main-select').find('.chose-select-val');
		var _child_li=_parent_ul.children('li');
		var _save_input=$(this).parent('.main-select').find('.save-input-val');
		var _input=$(this).parent('.main-select').find('input[data="data"]');
		var $this =$(this);
		$(this).hasClass('btn-hover-select')? $(this).removeClass('btn-hover-select'): $(this).addClass('btn-hover-select');
		_parent_ul.toggle();
		_child_li.on('click',function(){
			$(this).addClass('select-checked').siblings(_child_li).removeClass('select-checked');
			var liText=$(this).text();
			var liVal=$(this).attr('type');
			_save_input.attr('placeholder',liVal);
			_save_input.attr('value',liText);
			_input.attr('value',liVal);
			$('.chose-select-val').hide();
			$this.removeClass('btn-hover-select');
			     if(_input.attr('value')==""){
					 $this.parent('.required-select').css('border','1px solid #eb6755');
					 $this.parent('.required-select').next().css('display','inline-block');
					 _input.focus();
				
					/* return false; */
				}
				else{	
					$this.parent('.required-select').css('border','1px solid #e6e6e6');
					$this.parent('.required-select').next().hide();
				}
			
		});
	});	
	$('.btn-icon-select1').on('click',function(){
		var _parent_ul=$(this).parent('.main-select1').find('.chose-select-val1');
		var _child_li=_parent_ul.children('li');
		var _save_input=$(this).parent('.main-select1').find('.save-input-val1');
		var _input=$(this).parent('.main-select1').find('input[data="data"]');
		var $this =$(this);
		$(this).hasClass('btn-hover-select')? $(this).removeClass('btn-hover-select'): $(this).addClass('btn-hover-select');
		_parent_ul.toggle();
		_child_li.on('click',function(){
			$(this).addClass('select-checked').siblings(_child_li).removeClass('select-checked');
			var liText=$(this).text();
			var liVal=$(this).attr('type');
			_save_input.attr('placeholder',liVal);
			_save_input.attr('value',liText);
			_input.attr('value',liVal);
			$('.chose-select-val1').hide();
			$this.removeClass('btn-hover-select');
			     if(_input.attr('value')==""){
					 $this.parent('.required-select').css('border','1px solid #eb6755');
					 $this.parent('.required-select').next().css('display','inline-block');
					 _input.focus();
				
					/* return false; */
				}
				else{	
					$this.parent('.required-select').css('border','1px solid #e6e6e6');
					$this.parent('.required-select').next().hide();
				}
			
		});
	});
	/*function isNull(){
		 $('input[data="data"]').each(function(){
			 var _input_val=$(this).attr('value');
			 if(_input_val==""){
					$(this).parent('.main-select').css('border','1px solid #eb6755');
				};
		 });
	}
	//提交数据
*/	window.postData = function(data,callback){
		//各种逻辑
		//判断是否需要将数据派发到指定页面
		if(data && data['sendDataPage']){
			var frameObj = getNowIframeByHref(data['sendDataPage']);
			try{
				if(frameObj[0].contentWindow['receiveData'] && typeof frameObj[0].contentWindow['receiveData']=='function'){
					frameObj[0].contentWindow['receiveData'](data);
				}
			}catch(e){
				alert(e);
			}
		}
		//处理之后 如果需要 回调函数
		if(callback && typeof callback==='function'){
			callback({'status':1});
		}
	}

})